<?xml version="1.0" encoding="ISO-8859-1" ?>
<%
	MovieManager manager = new MovieManager();
	List<Movie> listMovie = manager.getMovie();
%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@page import="storeMovie.Util.MovieManager"%>
<%@page import="java.util.List"%>
<%@page import="storeMovie.JavaBean.Movie"%><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link href="style.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="Js/storemovieonline.js"></script>
<script type="text/javascript" src="Js/prototype.js"></script>
<script type="text/javascript" src="Js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="Js/lightbox.js"></script>

<script type="text/javascript" src="Js/jquery-1.4.2.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$("#urAccount").click(function() {
		$("#signin_menu").toggle();
	});

	$("#registry").click(function() {
		$("#regestry_menu").toggle();
	});
});
</script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<title>Insert title here</title>
</head>
<body>
	<div id="wrapper">
		<!-- inner tao khoang cach voi vien 2 ben -->
		<div id="inner">
			<div id="header">
				<!-- nen set width va height trong img, ko can phai de the div -->
				<h1><img src="images/logo.gif" width="519" height="63" alt="Online Movie Store" /></h1>
				<div id="nav">
                  <%
                  	String name= (String)session.getAttribute("userName");
                  	if (name==null){
                  %>
                  <a href="#" id="urAccount" title="Your account">your account</a> | <a href="#" onclick="viewCart()" id="cart" title="View your shop cart">view cart</a> | <a href="#" id="registry" title="click her if you want regis">Registry</a>
                  <%}else{ %>
					<a href="#" onclick="viewHistory()"><%=name %> </a>| <a href="#" id="cart" title="View your shop cart" onclick='viewCart()'>view cart</a> | <a href="logout.jsp" id="help" title="click her if you want log out">Log out</a>                  	
                  <%} %>
                   
              	</div>
	              	<fieldset id="signin_menu">
					    <form method="post" id="signin" action="loginprocess.jsp">
					      <label for="username">Username or email</label>
					      <input id="username" name="username" value="" title="username" tabindex="4" type="text"/>
					      <p>
					        <label for="password">Password</label>
					        <input id="password" name="password" value="" title="password" tabindex="5" type="password"/>
					      </p>
					      <p class="remember">
					        <input id="signin_submit" value="Sign in" tabindex="6" type="submit"/>
					        <input id="remember" name="remember_me" value="1" tabindex="7" type="checkbox"/>
					        <label for="remember">Remember me</label>
					      </p>
					    </form>
				  	</fieldset>
				  	
				  	<fieldset id="regestry_menu">
					    <form  method="post" id="signin" action="process.jsp">
					      <label for="username">Username or email</label>
					      <input id="username" name="userName" value="" title="username" tabindex="4" type="text" onblur="check(this.value)"/><span style="color: green;" id="txtCheck"></span>
					      <p>
					        <label for="password">Password</label>
					        <input id="password" name="password" value="" title="password" tabindex="5" type="password"/>
					      </p>
					      <p>
					      	<label for="displayName">Display Name: </label>
					      	<input id="displayName" name="displayName" type="text" tabindex="6"></input>
					      </p>
					      <p>
					        <input id="registry_submit" value="Registry" tabindex="7" type="submit"/>
					      </p>
					    </form>
				  	</fieldset>
				  	
				  	
              	<!-- co the de img trong a, ko nhat thiet phai de trong the div -->
              	<a href="#"><img src="images/header_1.jpg" width="744" height="145" alt="Harry Potter cd" /></a>
              	<a href="#"><img src="images/header_2.jpg" width="745" height="48" alt="" /></a>
			</div><!-- end header -->
			<dl id="browse">
	              <dt>Full Category Lists</dt>
	              <dd class="first"><a href="#" id="1" onclick="fc2(this.id)">Action &amp; Adventure</a></dd>
	              <dd><a href="#" id="2" onclick="fc2(this.id)">Anime &amp; Manga</a></dd>
	              <dd><a href="#" id="3" onclick="fc2(this.id)" >Art House &amp; International</a></dd>
	              <dd><a href="#" id="4" onclick="fc2(this.id)">Classics</a></dd>
	              <dd><a href="#" id="5" onclick="fc2(this.id)">Comedy</a></dd>
	              <dd><a href="#" id="6" onclick="fc2(this.id)">Cult Movies</a></dd>
	              <dd><a href="#" id="7" onclick="fc2(this.id)">Drama</a></dd>
	              <dd><a href="#" id="8" onclick="fc2(this.id)">New &amp; Future Releases</a></dd>
	              <dd><a href="#" id="9" onclick="fc2(this.id)">Horror</a></dd>
	              <dd><a href="#" id="10" onclick="fc2(this.id)">Musicals</a></dd>
	              <dd><a href="#" id="11" onclick="fc2(this.id)">Mystery &amp; Suspense</a></dd>
	              <dd><a href="#" id="12" onclick="fc2(this.id)">Science Fiction &amp; Fantasy</a></dd>
	              <dd class="last"><a href="#" id="13" onclick="fc2(this.id)">Westerns</a></dd>

	              <dt>Search Your Favorite Movie</dt>
	              <dd class="searchform">
	                <form method="get" name="myForm" >
	                    <div><select name="cat" id="category">
	                        <option value="-" selected="selected">CATEGORIES</option>
	                        <option value="-">Action &amp; Adventure</option>
	                        <option value="-">Anime &amp; Manga</option>
	                        <option value="-">Art House &amp; International</option>
	                        <option value="-">Classics</option>
	                        <option value="-">Comedy</option>
	                        <option value="-">Cult Movies</option>
	                        <option value="-">Drama</option>
	                        <option value="-">New &amp; Future Releases</option>
	                        <option value="-">Horror</option>
	                        <option value="-">Musicals</option>
	                        <option value="-">Mystery &amp; Suspense</option>
	                        <option value="-">Science Fiction &amp; Fantasy</option>
	                        <option value="-">Western</option>
	                    </select></div>
	                    <div><input id="txtSearch"  name="search" type="text" value="DVD TITLE" class="text" onfocus="fc1()"/></div>
	                    <div class="softright"><input type="button" onclick="searchMoive()" value="OK"/></div>
	                </form>
	              </dd>
         	 </dl>
         	 <div id="body">
              <div class="inner" id="result">
                  	<%
						//rsMovie.first();
						for (int i = 0; i < listMovie.size(); i++) {
							Movie movie = listMovie.get(i);
							if (i % 2 == 0) {
					%>
						<div id="leftbox<%=movie.getMovieId() %>" class="leftbox">
						   <h3><%=movie.getMovieName() %></h3>
						    <a href="#" rel="lightbox" title="<%=movie.getMovieName()%>" onclick="showDetail(<%=movie.getMovieId() %>)"><img  title="<%=movie.getMovieName()%>" src='<%=movie.getMovieImage()%>' width="93" height="95" alt="photo 1" class="left" /></a>
						    <p><b>Price:</b> <b>$<%=movie.getMoviePrice() %></b> &amp; eligible for FREE Super Saver Shipping on orders over <b></b>.</p>
						    <p><b>Availability:</b> Usually ships within 24 hours</p>
						    <p class="readmore"><a id="id<%=movie.getMovieId() %>" href="#" onclick="fc6(this.id,<%=movie.getMovieId() %>)">BUY <b>NOW</b></a></p>
						    <div class="clear"></div>
					     </div>
					<%
						} else {
					%>
						<div id="rightbox<%=movie.getMovieId() %>" class="rightbox">
						   <h3><%=movie.getMovieName() %></h3>
						    <a href="#" rel="lightbox" title="<%=movie.getMovieName()%>" onclick="showDetail(<%=movie.getMovieId() %>)"><img  title="<%=movie.getMovieName()%>" src='<%=movie.getMovieImage()%>' width="93" height="95" alt="photo 1" class="left" /></a>
						    <p><b>Price:</b> <b>$<%=movie.getMoviePrice() %></b> &amp; eligible for FREE Super Saver Shipping on orders over <b></b>.</p>
						    <p><b>Availability:</b> Usually ships within 24 hours</p>
						    <p class="readmore"><a id="id<%=movie.getMovieId() %>" href="#" onclick="fc6(this.id,<%=movie.getMovieId() %>)">BUY <b>NOW</b></a></p>
						    <div class="clear"></div>
					     </div>
					<%
						}
					%>
						 <% 
						if ((i % 2 == 1)&&(i!=listMovie.size()-1)) {							
					%>
						<div class="clear br"></div>
					<%
						}
							//rsMovie.next();
						}
					%>
              </div><!-- end .inner -->
          </div><!-- end body -->
          <div class="clear"></div>
          <div id="footer">Web design by <a href="#">quandh</a>&nbsp;
              <div id="footnav">
                  <a href="#">Legal</a> | <a href="#">Privacy Policy</a>
              </div><!-- end footnav -->
          </div><!-- end footer -->
          <div id="lblValues"></div>
		</div>
	</div>
	<script src="Js/jquery.tipsy.js" type="text/javascript"></script>
	<script type='text/javascript'>
    $(function() {
	  $('#urAccount').tipsy({gravity: 'e'});
	  $('#cart').tipsy({gravity: 'n'});
	  $('#help').tipsy({gravity: 's'});   
    });
	</script>
</body>
</html>